﻿// ------------------------------------------------------------------------------
// <copyright file="MenuSeparator.cs" company="skumaronline.com">
//    Copyright (C) 2012 Suresh Kumar T.
//
//    This program is free software; you can redistribute it and/or
//    modify it under the terms of the GNU General Public License
//    as published by the Free Software Foundation version 2
//    of the License.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    http://www.gnu.org/licenses/gpl-2.0.html
//
// </copyright>
// ------------------------------------------------------------------------------

namespace StoreAppLib.Controls
{
    using Windows.UI;
    using Windows.UI.Popups;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Media;

    /// <summary>
    /// Menu separator
    /// </summary>
    public sealed class MenuSeparator : Control, IMenuItem
    {
        /// <summary>
        /// Separator color dependency property
        /// </summary>
        public static readonly DependencyProperty SeparatorColorProperty =
            DependencyProperty.Register("SeparatorColor", typeof(SolidColorBrush), typeof(MenuSeparator), new PropertyMetadata(Menu.MenuSeparatorColor));
        
        /// <summary>
        /// Separator thickness dependency property
        /// </summary>
        public static readonly DependencyProperty SeparatorThicknessProperty =
            DependencyProperty.Register("SeparatorThickness", typeof(double), typeof(MenuSeparator), new PropertyMetadata(Menu.MenuSeparatorThickness));
        
        /// <summary>
        /// Initializes a new instance of the <see cref="MenuSeparator" /> class
        /// </summary>
        public MenuSeparator()
        {
            this.SeparatorColor = Menu.MenuSeparatorColor;
            this.SeparatorThickness = Menu.MenuSeparatorThickness;
        }

        /// <summary>
        /// Gets or sets Separator thickness property.
        /// </summary>
        /// <value>
        /// The Separator thickness.
        /// </value>
        public double SeparatorThickness
        {
            get
            {
                return (double)this.GetValue(SeparatorThicknessProperty);
            }

            set
            {
                this.SetValue(SeparatorThicknessProperty, value);
            }
        }

        /// <summary>
        /// Gets or sets Separator color property.
        /// </summary>
        /// <value>
        /// The Separator color.
        /// </value>
        public SolidColorBrush SeparatorColor
        {
            get
            {
                return (SolidColorBrush)this.GetValue(SeparatorColorProperty);
            }

            set
            {
                this.SetValue(SeparatorColorProperty, value);
            }
        }
    }
}
